Skip to content

#411 Fixed bug when saving sketch as. Made native file dialogs modal. #1322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Aug 15, 2022

Motivation

This PR is the outcome of the investigation of #411. This PR fixes the default location when saving a sketch as. From now on, every native file dialog is modal.

Change description

Noteworthy changes:

  • If the sketch is temp, the default save location is directories/user/sketch_$current_date,
save_as__temp.mp4
  • If a sketch is contained in the default location as directories/user/sketch, then the default location will be directories/user/sketch_copy_date,
save_as__in_sketchbook.mp4
  • If a sketch is outside of the sketchbook, then the default location will be directories/user/sketch_$current_date,
save_as__outside_sketchbook.mp4
  • If the sketch is in a nested folder in the sketchbook, then the default location will be directories/user/nested/location/sketch_$current_date.
save_as__nested_in_sketchbook.mp4

Other information

I could not reproduce the defect described here and here.

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 16, 2022
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working fine for me on both Windows and Linux. However, some things were not clear to me:

fixes the default location when saving a sketch as

What was the bug @kittaakos? Was it that the IDE did not follow this behavior?:

If the sketch is in a nested folder in the sketchbook, then the default location will be directories/user/nested/location/sketch_$current_date.

That was the only difference I noticed related to default Save as location when comparing the build from this PR to the latest one from the main branch.

I could not reproduce the defect described #411 (comment) and #411 (comment).

Closes #411.

It is not clear to me how it is considered as fixing #411 Would you mind providing more information about how the changes made in this PR are related to that issue?

@davegarthsimpson davegarthsimpson self-requested a review August 29, 2022 14:40
Copy link
Contributor

@davegarthsimpson davegarthsimpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-wise approved.

@per1234
Copy link
Contributor

per1234 commented Aug 29, 2022

I am also willing to approve this (though I would like to give it another try after a rebase).

I only wanted to make sure I fully understand the intention and context so that I would not omit an important "assertion" in my manual testing.

@davegarthsimpson davegarthsimpson marked this pull request as draft August 30, 2022 09:58
@davegarthsimpson davegarthsimpson added the status: on hold Do not proceed at this time label Aug 30, 2022
Signed-off-by: Akos Kitta <[email protected]>
@kittaakos kittaakos force-pushed the #411 branch 2 times, most recently from f5be9d3 to 066b767 Compare September 21, 2022 09:15
@kittaakos kittaakos marked this pull request as ready for review September 21, 2022 09:26
@kittaakos kittaakos removed the status: on hold Do not proceed at this time label Sep 21, 2022
@kittaakos
Copy link
Contributor Author

It is working fine for me on both Windows and Linux. However, some things were not clear to me:

fixes the default location when saving a sketch as

What was the bug @kittaakos? Was it that the IDE did not follow this behavior?:

Yes. If there is a sketch under #directories/user/nested_folder/my_sketch and the user tries to perform a Save As..., the #directories/user/my_sketch will be the default save as location.

IDE 2.0.0:

default_save_as_location_2.0.0.mp4

With the fix, the #directories/user/nested_folder/my_sketch_copy_$TIMESTAMP will be proposed.

IDE from PR:

default_save_as_location_PR.mp4

The other change is the use of modal dialogs in IDE2.

Please review. Thank you!

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified again that the switch to modal file dialogs and more convenient default "Save As" location works correctly on both Windows and Linux.

Thanks Akos!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants